package com.android.videotest.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;

import androidx.annotation.NonNull;

import com.android.htdvideoview.IjkVideoView;
import com.android.videotest.Urls;

/**
 * 项目名称：VideoTest
 * 类 名 称：VideoDialog
 * 类 描 述：TODO
 * 创建时间：2019-11-17 00:33
 * 创 建 人：sansecy
 */
public class VideoDialog extends Dialog {

    private IjkVideoView mVideoView;

    public VideoDialog(@NonNull Context context) {
        this(context, 0);
    }

    public VideoDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mVideoView = new IjkVideoView(getContext());
        setContentView(mVideoView);
        mVideoView.loadUrl(Urls.videoUrl);
    }

    @Override
    protected void onStop() {
        super.onStop();
    }

    @Override
    public void dismiss() {
        super.dismiss();
        mVideoView.stopPlayback();
    }
}
